from multiprocessing import Process
from time import sleep
import os

def run(str):
    while True:
        print("excute run %s function--%s,子进程id为%s"%(str,os.getpid(),os.getppid()))
        sleep(1)

if __name__=="__main__":
    print("启动父进程%s"%(os.getpid()))
    p=Process(target=run,args=("good",))
    p.start()
    while True:
        print("python is good")
        sleep(1.5)